package com.ruoyi.system.service.impl;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.client.HSClient;
import com.ruoyi.common.constant.HuaSuConstant;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.domain.vo.huimin.FilmlVo;
import com.ruoyi.system.service.IHuiminScreeningService;
import lombok.RequiredArgsConstructor;
import net.sf.jsqlparser.parser.JJTCCJSqlParserState;
import org.springframework.stereotype.Service;

import javax.xml.bind.util.JAXBSource;
import java.util.List;

/**
 * @ClassName HuiminScreeningServiceIpml
 * @Author YangFu
 * @Date 2024/3/17 18:29
 * @Version 1.0
 */
@Service
@RequiredArgsConstructor
public class HuiminScreeningServiceImpl implements IHuiminScreeningService {

    private final HSClient hsClient;

    @Override
    public List<FilmlVo> getHuimin(String token) {
        String moviePrefix = HuaSuConstant.MOVIE_PREFIX;
        R request = hsClient.getRequest(moviePrefix, FilmlVo.class,token);
        Object data = request.getData();
        String json = JSON.toJSONString(data);
        return JSON.parseArray(json, FilmlVo.class);
    }
}
